hook::add message bot:anekdot 80
set opt(anekdot) 1
proc bot:anekdot {from type body} {

if {[cmd "$body" anekdot]} {
	global an
		set answ [lindex $an [randomnum [llength $an]]]
		putlog $answ
		if {$type=="groupchat"} {
			gm "$from" "$answ"
			return stop
		} elseif {$type=="chat"} {
			pm "$from" "$answ"
			return stop
		} else {return stop}
	}
}
